package Optimistic;

import Pessimistic.Operate;

public class OptimisticLock {
    //乐观锁不需要通过锁来保证线程安全
    public static void main(String[] args) {
        OptimisticOperate optimisticOperate = new OptimisticOperate();
        for (int i = 0; i < 100; i++) {
            new Thread(()->{
                optimisticOperate.take();
            }).start();
        }

    }
}
